using System.ComponentModel;

namespace AuthService.Domain.OAuth
{
    /// <summary>
    /// OAuth授权类型枚举
    /// </summary>
    public enum OAuthGrantType
    {
        /// <summary>
        /// 授权码模式
        /// </summary>
        [Description("授权码模式")]
        AuthorizationCode = 0,

        /// <summary>
        /// 隐式模式
        /// </summary>
        [Description("隐式模式")]
        Implicit = 1,

        /// <summary>
        /// 密码模式
        /// </summary>
        [Description("密码模式")]
        Password = 2,

        /// <summary>
        /// 客户端凭证模式
        /// </summary>
        [Description("客户端凭证模式")]
        ClientCredentials = 3,

        /// <summary>
        /// 刷新令牌模式
        /// </summary>
        [Description("刷新令牌模式")]
        RefreshToken = 4,

        /// <summary>
        /// 设备码模式
        /// </summary>
        [Description("设备码模式")]
        DeviceCode = 5,

        /// <summary>
        /// JWT授权模式
        /// </summary>
        [Description("JWT授权模式")]
        JwtBearer = 6,

        /// <summary>
        /// SAML2授权模式
        /// </summary>
        [Description("SAML2授权模式")]
        Saml2Bearer = 7,

        /// <summary>
        /// 扩展授权模式
        /// </summary>
        [Description("扩展授权模式")]
        Extension = 8,

        /// <summary>
        /// 自定义授权模式
        /// </summary>
        [Description("自定义授权模式")]
        Custom = 9
    }

    /// <summary>
    /// OAuth响应类型枚举
    /// </summary>
    public enum OAuthResponseType
    {
        /// <summary>
        /// 授权码
        /// </summary>
        [Description("授权码")]
        Code = 0,

        /// <summary>
        /// 令牌
        /// </summary>
        [Description("令牌")]
        Token = 1,

        /// <summary>
        /// ID令牌
        /// </summary>
        [Description("ID令牌")]
        IdToken = 2,

        /// <summary>
        /// 令牌ID令牌混合
        /// </summary>
        [Description("令牌ID令牌混合")]
        TokenIdToken = 3,

        /// <summary>
        /// 授权码ID令牌混合
        /// </summary>
        [Description("授权码ID令牌混合")]
        CodeIdToken = 4,

        /// <summary>
        /// 授权码令牌ID令牌混合
        /// </summary>
        [Description("授权码令牌ID令牌混合")]
        CodeTokenIdToken = 5,

        /// <summary>
        /// 无
        /// </summary>
        [Description("无")]
        None = 6
    }

    /// <summary>
    /// OAuth客户端类型枚举
    /// </summary>
    public enum OAuthClientType
    {
        /// <summary>
        /// 公共客户端
        /// </summary>
        [Description("公共客户端")]
        Public = 0,

        /// <summary>
        /// 机密客户端
        /// </summary>
        [Description("机密客户端")]
        Confidential = 1,

        /// <summary>
        /// 单页应用
        /// </summary>
        [Description("单页应用")]
        SinglePageApplication = 2,

        /// <summary>
        /// 原生应用
        /// </summary>
        [Description("原生应用")]
        Native = 3,

        /// <summary>
        /// Web应用
        /// </summary>
        [Description("Web应用")]
        WebApplication = 4,

        /// <summary>
        /// 服务器应用
        /// </summary>
        [Description("服务器应用")]
        ServerApplication = 5,

        /// <summary>
        /// 设备应用
        /// </summary>
        [Description("设备应用")]
        DeviceApplication = 6,

        /// <summary>
        /// 机器对机器应用
        /// </summary>
        [Description("机器对机器应用")]
        MachineToMachine = 7
    }

    /// <summary>
    /// OAuth作用域枚举
    /// </summary>
    public enum OAuthScope
    {
        /// <summary>
        /// OpenID连接
        /// </summary>
        [Description("OpenID连接")]
        OpenId = 0,

        /// <summary>
        /// 用户档案
        /// </summary>
        [Description("用户档案")]
        Profile = 1,

        /// <summary>
        /// 邮箱
        /// </summary>
        [Description("邮箱")]
        Email = 2,

        /// <summary>
        /// 地址
        /// </summary>
        [Description("地址")]
        Address = 3,

        /// <summary>
        /// 电话
        /// </summary>
        [Description("电话")]
        Phone = 4,

        /// <summary>
        /// 离线访问
        /// </summary>
        [Description("离线访问")]
        OfflineAccess = 5,

        /// <summary>
        /// 所有
        /// </summary>
        [Description("所有")]
        All = 6,

        /// <summary>
        /// 读权限
        /// </summary>
        [Description("读权限")]
        Read = 7,

        /// <summary>
        /// 写权限
        /// </summary>
        [Description("写权限")]
        Write = 8,

        /// <summary>
        /// 删除权限
        /// </summary>
        [Description("删除权限")]
        Delete = 9,

        /// <summary>
        /// 管理权限
        /// </summary>
        [Description("管理权限")]
        Admin = 10,

        /// <summary>
        /// API访问
        /// </summary>
        [Description("API访问")]
        Api = 11,

        /// <summary>
        /// 审计日志
        /// </summary>
        [Description("审计日志")]
        AuditLog = 12,

        /// <summary>
        /// 报告
        /// </summary>
        [Description("报告")]
        Reports = 13,

        /// <summary>
        /// 分析
        /// </summary>
        [Description("分析")]
        Analytics = 14,

        /// <summary>
        /// 自定义
        /// </summary>
        [Description("自定义")]
        Custom = 15
    }

    /// <summary>
    /// OAuth认证模式枚举
    /// </summary>
    public enum OAuthAuthenticationMethod
    {
        /// <summary>
        /// 无
        /// </summary>
        [Description("无")]
        None = 0,

        /// <summary>
        /// 客户端密钥基本认证
        /// </summary>
        [Description("客户端密钥基本认证")]
        ClientSecretBasic = 1,

        /// <summary>
        /// 客户端密钥Post认证
        /// </summary>
        [Description("客户端密钥Post认证")]
        ClientSecretPost = 2,

        /// <summary>
        /// 客户端密钥JWT
        /// </summary>
        [Description("客户端密钥JWT")]
        ClientSecretJwt = 3,

        /// <summary>
        /// 私钥JWT
        /// </summary>
        [Description("私钥JWT")]
        PrivateKeyJwt = 4,

        /// <summary>
        /// TLS客户端认证
        /// </summary>
        [Description("TLS客户端认证")]
        TlsClientAuth = 5,

        /// <summary>
        /// 自签名JWT
        /// </summary>
        [Description("自签名JWT")]
        SelfSignedJwt = 6,

        /// <summary>
        /// 持有者令牌
        /// </summary>
        [Description("持有者令牌")]
        BearerToken = 7,

        /// <summary>
        /// API密钥
        /// </summary>
        [Description("API密钥")]
        ApiKey = 8,

        /// <summary>
        /// 相互TLS
        /// </summary>
        [Description("相互TLS")]
        MutualTls = 9,

        /// <summary>
        /// 设备认证
        /// </summary>
        [Description("设备认证")]
        DeviceAuthentication = 10
    }

    /// <summary>
    /// PKCE挑战方法枚举
    /// </summary>
    public enum PkceChallengeMethod
    {
        /// <summary>
        /// 无
        /// </summary>
        [Description("无")]
        None = 0,

        /// <summary>
        /// plain
        /// </summary>
        [Description("plain")]
        Plain = 1,

        /// <summary>
        /// S256
        /// </summary>
        [Description("S256")]
        S256 = 2,

        /// <summary>
        /// 自定义
        /// </summary>
        [Description("自定义")]
        Custom = 3
    }

    /// <summary>
    /// 设备授权状态枚举
    /// </summary>
    public enum DeviceAuthorizationStatus
    {
        /// <summary>
        /// 等待用户确认
        /// </summary>
        [Description("等待用户确认")]
        Pending = 0,

        /// <summary>
        /// 缓慢
        /// </summary>
        [Description("缓慢")]
        SlowDown = 1,

        /// <summary>
        /// 已拒绝
        /// </summary>
        [Description("已拒绝")]
        Expired = 2,

        /// <summary>
        /// 已完成
        /// </summary>
        [Description("已完成")]
        Completed = 3,

        /// <summary>
        /// 已拒绝
        /// </summary>
        [Description("已拒绝")]
        Denied = 4,

        /// <summary>
        /// 错误
        /// </summary>
        [Description("错误")]
        Error = 5,

        /// <summary>
        /// 超时
        /// </summary>
        [Description("超时")]
        Timeout = 6,

        /// <summary>
        /// 取消
        /// </summary>
        [Description("取消")]
        Cancelled = 7
    }

    /// <summary>
    /// OAuth令牌吊销原因枚举
    /// </summary>
    public enum OAuthTokenRevocationReason
    {
        /// <summary>
        /// 用户请求
        /// </summary>
        [Description("用户请求")]
        UserRequest = 0,

        /// <summary>
        /// 管理员吊销
        /// </summary>
        [Description("管理员吊销")]
        AdminRevocation = 1,

        /// <summary>
        /// 密码重置
        /// </summary>
        [Description("密码重置")]
        PasswordReset = 2,

        /// <summary>
        /// 账户禁用
        /// </summary>
        [Description("账户禁用")]
        AccountDisabled = 3,

        /// <summary>
        /// 权限变更
        /// </summary>
        [Description("权限变更")]
        PermissionChanged = 4,

        /// <summary>
        /// 安全事件
        /// </summary>
        [Description("安全事件")]
        SecurityEvent = 5,

        /// <summary>
        /// 客户端吊销
        /// </summary>
        [Description("客户端吊销")]
        ClientRevocation = 6,

        /// <summary>
        /// 会话超时
        /// </summary>
        [Description("会话超时")]
        SessionTimeout = 7,

        /// <summary>
        /// 异地登录
        /// </summary>
        [Description("异地登录")]
        RemoteLogin = 8,

        /// <summary>
        /// 可疑活动
        /// </summary>
        [Description("可疑活动")]
        SuspiciousActivity = 9,

        /// <summary>
        /// 系统维护
        /// </summary>
        [Description("系统维护")]
        SystemMaintenance = 10,

        /// <summary>
        /// 合规要求
        /// </summary>
        [Description("合规要求")]
        ComplianceRequirement = 11,

        /// <summary>
        /// 其他
        /// </summary>
        [Description("其他")]
        Other = 12
    }
}